package pri.zey.custom.tools;/**
 * Created by Administrator on 2016/3/16.
 */

import android.util.Log;

import java.util.List;

/**
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>类描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>属性描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>方法描述
 */
public class TL implements TlBase {

    private String tag;

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public TL(){
        setTag(this.toString());
    }

    public TL(Object object){
        setTag(object.getClass().toString());
    }

    public static void EE(String tag, List<String> list){
        if (isOpenState)
            for (String str : list){
                str = "TAGSS---->" + str;
                if(str.equals(list.get(0))){
                    e(tag, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                    i(tag, str);
                }else if(str.equals(list.get(list.size()))) {
                    i(tag, str);
                    e(tag, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                }else{
                    i(tag, str);
                }
            }
    }

    public static void Map(List<TlBean> list){
        Log.e("TAGSS", "<<<<<<<<<<<<<<<<<<<<<<<<<");
        if (isOpenState)
            for (TlBean TLBean : list){
                String str = TLBean.tag;
                String msg = "TAGSS----> " + TLBean.msg;
                switch (str){
                    case vL:
                        v(str, msg);
                        break;
                    case dL:
                        d(str, msg);
                        break;
                    case iL:
                        i(str, msg);
                        break;
                    case wL:
                        w(str, msg);
                        break;
                    case eL:
                        e(str, msg);
                        break;
                    default:
                        e("default", "*******************************");
                        e("default", str + ":----:" + msg);
                        break;
                }
            }
    }

    //***************************************
    public static void v(String tag, String msg){
        if (isOpenState)
            if(LEVEL<=VERBOSE){
                Log.v(tag,msg);
            }
    }
    public static void d(String tag, String msg){
        if (isOpenState)
            if(LEVEL<=DEBUG){
                Log.d(tag, msg);
            }
    }
    public static void i(String tag, String msg){
        if (isOpenState)
            if(LEVEL<=INFO){
                Log.i(tag, msg);
            }
    }
    public static void w(String tag, String msg){
        if (isOpenState)
            if(LEVEL<=WARN){
                Log.w(tag, msg);
            }
    }
    public static void e(String tag, String msg){
        if (isOpenState)
            if(LEVEL<=ERROR){
                Log.e(tag, msg);
            }
    }

    //***************************************
    public void v(String msg){
        if (isOpenState)
            if(LEVEL<=VERBOSE){
                TL.v(getTag(),msg);
            }
    }
    public void d(String msg){
        if (isOpenState)
            if(LEVEL<=DEBUG){
                TL.d(getTag(), msg);
            }
    }
    public void i(String msg){
        if (isOpenState)
            if(LEVEL<=INFO){
                TL.i(getTag(), msg);
            }
    }
    public void w(String msg){
        if (isOpenState)
            if(LEVEL<=WARN){
                TL.w(getTag(), msg);
            }
    }
    public void e(String msg){
        if (isOpenState) {
            if (LEVEL <= ERROR) {
                TL.e(getTag(), msg);
            }
        }
    }
}
